package com.zoe.app.completeFuture_入门;

import cn.hutool.core.thread.ThreadUtil;
import com.zoe.app.util.SmallTool;
import lombok.AllArgsConstructor;
import lombok.Data;

/**
 * @author zoe.Zhang
 * @date 2022/07/22
 * @description
 */
@Data
@AllArgsConstructor
public class Dish {
    private String name;
    private Integer productionTime;

    public String make() {
        ThreadUtil.sleep(productionTime * 1000); // 线程睡眠 productionTime 秒
        SmallTool.printTimeAndThread(this.name + "+ 制作完毕,可以开吃...");
        return Thread.currentThread().getName();
    }

    public String makeStr(String name) {
        ThreadUtil.sleep(productionTime * 1000); // 线程睡眠 productionTime 秒
        SmallTool.printTimeAndThread(this.name + "+ 制作完毕,可以开吃...");
        return name;
    }
}
